-> root -> software -> ::software::mkinitramfs
All notes about mkinitramfs, one of the linux tools to create initrds.
Notes on this page:

Using cryptpart and suspend to disk in Debian, and encrypted root
[46]

At time of writing, if you want to use cryptsetup, dmcrypt, and all those cool new things, the only option you have to be able to boot your system out of an encrypted root partition is to use mkinitramfs. Both yaird and mkinitrd are unable to generate images supporting resume from swap AND encrypted filesystems. Just:
 apt-get install mkinitramfs
 
and change /etc/kernel-img.conf, to have something like:
 ramdisk = mkinitramfs
 
now, install the kernel you want, do all the setup you need to do to have all the encryption you want, and finally run:
 % uname -a 
 Linux matteotti 2.6.8-3-686-smp #1 SMP Tue Dec 5 23:17:50 UTC 2006 i686 GNU/Linux
 % update-initramfs -k 2.6.8-3-686-smp -u
 
or similar. Make sure you have a backup of /boot/initrd.whatever handy in case initramfs generated an unusable ramdisk (it can easily happen!)

Debugging an initrd made with mkinitramfs
[52]

mkinitramfs allows you to specify some parameters on the LILO or GRUB prompt to easily (sure) debug problems. Most useful parameters are probably:

  • debug, to have all the shell scripts on the initrd run with the -x parameter, and the output logged in /tmp/initramfs.debug on the ramdisk. To have the output sent to stdout, specify something like debug=/dev/console.

  • break, to have the initrd return a shell prompt. If no parameters are specified, the prompt will be returned when most convenient to the initrd (at current time, just before mounting the root filesystem - premount). Otherwise, you can specify something like break=whatever, to ask the initrd to stop at exactly the specified step. Steps currently defined by mkinitramfs are: top, modules, premount, mount, bottom and init.

  • blacklist, if you suspect a module is causing problems to your hardware. Specify something like blacklist="module1 module2" to have module1 and module2 not loaded at boot time.

As I use grub on my system, to specify those parameter at boot time, I usually press 'e' on the line I usually boot from. Once there, I modify the line:
   kernel /vmlinuz root=/dev/mapper/root ro
   
to have the options I need:
   kernel /vmlinuz root=/dev/mapper/root ro break=top
   
and finally press 'b' to get the system booted with the specified parameters.

Generated by CRON on 2012/02/14 at 06:26:35.